package com.bjgov.scoresys.util;

import org.apache.commons.lang.StringUtils;

public class StringUtil {
	public static String getLength(String str) {
		String result="";
		if(StringUtils.isEmpty(str)) {
			return "";
		}
		String[] arr = str.split(",");
		for(int i=0;i<arr.length-1;i++)
		{
			result+="━";
		}
		return result;
	}
	
	public static String cutLastComm(String str) {
		if(StringUtils.isEmpty(str)) {
			return "";
		}
		if(str.endsWith(",")) {
			return str.substring(0,str.length()-1);
		}
		return str;
	}
	
	public static void main(String[] args) {
		System.out.println(cutLastComm("123,456,7,"));
	}
}
